<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<title>Insert title here</title>
  <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/plugins/bootstrap/css/bootstrap.css">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/plugins/font-awesome/css/font-awesome.css">
 <link   href="${pageContext.request.contextPath}/assets/plugins/layer/skin/default/layer.css" rel="stylesheet" type="text/css" />
 
 <style type="text/css">
    .head-top{
       height:50px;
       line-height:50px;
       background-color:#429BFE;
       text-align: center;
       font-size:18px;
       color:#fff;
       position: relative;
    }
    .top-reback{
       float:right;
       font-size:14px;
       padding:0 10px;
       cursor:pointer;
       position: absolute;
       top:0;
       right:0;
       font-size:12px;
    }
    .explain-box > span{
       height:35px;
       line-height:35px;
       padding:0 10px;
       font-size:12px;
    }
    .content-box{
      text-align: left;
      padding:0 10px;
      text-indent: 2em;
      font-size:12px;
      line-height:20px;
      margin-top:10px;
    }
 </style> 
</head>
<body>
	<div class="main-box">
	    <div class="head-top">
	      <div id="dinamic-title">机构动态</div>
	      <span class="top-reback" style="float:right;">
	                       返回
	         <i class="glyphicon glyphicon-share-alt"></i>
	      </span>
	    </div>
	    <div class="explain-box clearfix">
	       <span class="pull-left" id="author">作者:<!-- 申升 --></span>
	       <span class="pull-right" id="create-date">日期:<!-- 2017-08-16 --></span>
	    </div>
	    <div class="content-box">
	         <!-- 今天天气很好今天天气很好今天天气很好今天天气很 -->
	    </div>
	</div>
	
	<input type="hidden" id="CODE" value="${CODE}"	/>

  <script src="${pageContext.request.contextPath}/assets/js/jquery-1.11.2.min.js" charset="utf-8" type="text/javascript"></script>
  <script src="${pageContext.request.contextPath}/assets/plugins/bootstrap/js/bootstrap.min.js"></script>
  <script src="${pageContext.request.contextPath}/assets/plugins//layer/mobile/layer.js"></script>
  <script src="${pageContext.request.contextPath}/assets/plugins/layer/layer.js"></script>  
  
  <script type="text/javascript">
     var curPage={
    		 init:function(){
    			 this.initEvents();
    			 this.getItemInfo();
    		 },
    		 initEvents:function(){
    			 $(".top-reback").on("click",function(){
    				 window.history.go(-1);
    			 })
    		 },
    		 getItemInfo:function(){
				var that = this;  
    			 
    			 var params={};
    			 params.CODE=$("#CODE").val();
    			 
    			 $.post("${pageContext.request.contextPath}/Portal/portal/GDYMBYC01.do",params,function(result){       				  
    				 try{
    					 var html =""; 		   			 
        				 if(result.state==200){       				
        					 $("#author").text("作者："+result.data.AUTHOR);
        					 $("#create-date").text("发布日期："+that.dataformat(result.data.CREATE_DATE.time));
        					 $("#dinamic-title").text(result.data.TITLE)
        					 $(".content-box").text(result.data.CONTENT);
        				 }else{
        					 layer.msg("暂无数据");	 
        				 }
    				 }catch(e){
    					 layer.msg("获取数据失败,重新刷新页面");
    				 }
    			 }) 
    			 return that; 
    		 },
   		     dataformat:function(format){    			  
				  try{
					  
					  if(format.split('-').length>0){
						  return format
					  }
					  
	    			  var date = new Date(format);
	    			  var year = date.getFullYear();
	    			  var month = date.getMonth()+1;
	    			  var day = date.getDate();
	    			  if(month<10){
	    				  return year +"-"+"0"+month+"-"+day;  
	    			  }else{
	    				  return year +"-"+month+"-"+day;
	    			  }        			  
				  }   catch(e){
					  return "2017-08-19"
				  } 
		   }
     }
     
     
     $(function(){
    	 curPage.init();
     })
  </script>
  
  
</body>
</html>